package com.ruoyi.vote.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.vote.mapper.ResultOptionMapper;
import com.ruoyi.vote.domain.ResultOption;
import com.ruoyi.vote.service.IResultOptionService;
import com.ruoyi.common.core.text.Convert;

/**
 * 结果选项Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-05
 */
@Service
public class ResultOptionServiceImpl implements IResultOptionService 
{
    @Autowired
    private ResultOptionMapper resultOptionMapper;

    /**
     * 查询结果选项
     * 
     * @param resultId 结果选项主键
     * @return 结果选项
     */
    @Override
    public ResultOption selectResultOptionByResultId(Long resultId)
    {
        return resultOptionMapper.selectResultOptionByResultId(resultId);
    }

    /**
     * 查询结果选项列表
     * 
     * @param resultOption 结果选项
     * @return 结果选项
     */
    @Override
    public List<ResultOption> selectResultOptionList(ResultOption resultOption)
    {
        return resultOptionMapper.selectResultOptionList(resultOption);
    }

    /**
     * 新增结果选项
     * 
     * @param resultOption 结果选项
     * @return 结果
     */
    @Override
    public int insertResultOption(ResultOption resultOption)
    {
        return resultOptionMapper.insertResultOption(resultOption);
    }

    /**
     * 修改结果选项
     * 
     * @param resultOption 结果选项
     * @return 结果
     */
    @Override
    public int updateResultOption(ResultOption resultOption)
    {
        return resultOptionMapper.updateResultOption(resultOption);
    }

    /**
     * 批量删除结果选项
     * 
     * @param resultIds 需要删除的结果选项主键
     * @return 结果
     */
    @Override
    public int deleteResultOptionByResultIds(String resultIds)
    {
        return resultOptionMapper.deleteResultOptionByResultIds(Convert.toStrArray(resultIds));
    }

    /**
     * 删除结果选项信息
     * 
     * @param resultId 结果选项主键
     * @return 结果
     */
    @Override
    public int deleteResultOptionByResultId(Long resultId)
    {
        return resultOptionMapper.deleteResultOptionByResultId(resultId);
    }
}
